import Vue from 'vue';
import Util from '../libs/util';
import VueRouter from 'vue-router';
import {routers} from './router';

Vue.use(VueRouter);

// 路由配置
const RouterConfig = {
   mode: 'history',
    routes: routers
};

export const router = new VueRouter(RouterConfig);

router.beforeEach((to, from, next) => {
    Util.title(to.meta.title);
    /* //是否登录
    if(Cookies.get('islogin')){

    } */
    next();
});

router.afterEach((to) => {
    window.scrollTo(0, 0);
});
